Conversation
sproshev
suggested changes
May 28, 2018
| return null; | ||
| } | ||
| }) | ||
| .filter(s -> s.matches(".*"+sequence.toString()+".*")) |
There was a problem hiding this comment.
вызов toString на sequence надо убрать (его и до этого не должно было быть)
| return Files.lines(Paths.get(p)); | ||
| } catch (IOException e) { | ||
| // TODO Auto-generated catch block | ||
| e.printStackTrace(); |
There was a problem hiding this comment.
плохой способ обработки ошибок) либо пробрасываем наружу, см UncheckedIOException, либо как-то игнорируем
| c[0] += 1; | ||
| return c; | ||
| }); | ||
| return experimentCount[1] / experimentCount[0]; |
There was a problem hiding this comment.
верно ли, что после свертки c[0] == experimentCount[0] == 10000?
| .stream() | ||
| .max(Comparator.comparingLong(entr -> entr.getValue() | ||
| .stream() | ||
| .flatMapToInt(String::chars) |
There was a problem hiding this comment.
зачем подсчитывать символы, если известна длина строки? String.length
| .max(Comparator.comparingLong(entr -> entr.getValue() | ||
| .stream() | ||
| .flatMapToInt(String::chars) | ||
| .count())).orElse(new Entry<String, List<String>>() { |
There was a problem hiding this comment.
лучше сперва сделать map, а потом orElse(null)
| assertEquals("Auth2", | ||
| SecondPartTasks.findPrinter(testMap)); | ||
|
|
||
| testMap = new HashMap<>(); |
| "bc", | ||
| "cdk")); | ||
|
|
||
| testMap.put("Auth3", Arrays.asList()); |
| @Test | ||
| public void testFindQuotes() { | ||
| assertEquals( | ||
| Arrays.asList("askdlcewline kabra"), |
sproshev
reviewed
May 30, 2018
| .stream() | ||
| .max(Comparator.comparingInt(entr -> entr.getValue() | ||
| .stream() | ||
| .collect(Collectors.summingInt(String::length)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.